package com.japstudy.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.japstudy.dao.IWordDao;
import com.japstudy.entity.Grade;
import com.japstudy.entity.Word;
import com.japstudy.service.IWordService;

@Service
public class WordServiceImpl implements IWordService{

	@Autowired
	private IWordDao iWordDao;
	
	@Override
	public int add(Word word) {
		return iWordDao.add(word);
	}

	@Override
	public int update(Word word) {
		return iWordDao.update(word);
	}

	@Override
	public int delete(Word word) {
		return iWordDao.delete(word);
	}

	@Override
	public Word selectById(String id) {
		return iWordDao.selectById(id);
	}

	@Override
	public List<Word> selectAll() {
		return iWordDao.selectAll();
	}

	@Override
	public List<Word> selectByNameLike(String wordName) {
		return iWordDao.selectByNameLike(wordName);
	}

	@Override
	public List<Word> selectByGradeId(List<Grade> grades) {
		return iWordDao.selectByGradeId(grades);
	}

	@Override
	public List<Word> selectByGradeIdAndStar(List<Grade> grades, String userId) {
		return iWordDao.selectByGradeIdAndStar(grades, userId);
	}

	@Override
	public List<Word> selectByGradeIdAndWrong(List<Grade> grades, String userId) {
		return iWordDao.selectByGradeIdAndWrong(grades, userId);
	}

	@Override
	public List<Word> selectAllStarWordByUserId(String userId) {
		return iWordDao.selectAllStarWordByUserId(userId);
	}

	@Override
	public List<Word> selectAllWrongWordByUserId(String userId) {
		return iWordDao.selectAllWrongWordByUserId(userId);
	}

	@Override
	public List<Word> selectWrongByNameLike(String wordName, String userId) {
		return iWordDao.selectWrongByNameLike(wordName, userId);
	}

	@Override
	public List<Word> selectStarByNameLike(String wordName, String userId) {
		return iWordDao.selectStarByNameLike(wordName, userId);
	}

}
